import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class StringExtractor {

    public static void main(String[] args) {
        try (BufferedReader reader = new BufferedReader(new FileReader("source.txt"))) {
            String line;
            while ((line = reader.readLine()) != null) {
                extractStrings(line);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private static void extractStrings(String line) {
        StringBuilder extractedString = new StringBuilder();
        boolean inString = false;
        boolean escaped = false;

        for (char c : line.toCharArray()) {
            if (escaped) {
                extractedString.append(c);
                escaped = false;
            } else if (c == '"') {
                inString = !inString;
            } else if (inString && c == '\\') {
                escaped = true;
            } else if (inString) {
                extractedString.append(c);
            }
        }

        System.out.println(extractedString.toString());
    }
}
